package club.justwill.single.persistence.support;

import javax.persistence.Column;
import javax.persistence.MappedSuperclass;

/**
 * Created by luoyu on 15-12-24.
 */
@MappedSuperclass
public class OrdersBase extends Jpo {

    @Column(name = "user_id")
    private long userId;

    @Column(name = "name")
    private String name;

    @Column(name = "phone_number")
    private String phoneNumber;

    @Column(name = "province")
    private String province;

    @Column(name = "city")
    private String city;

    @Column(name = "address")
    private String address;

    @Column(name = "use_comments")
    private String useComments;

    @Column(name = "service_comments")
    private String serviceComments;

    @Column(name = "status")
    private int status;

    @Column(name = "serial_number")
    private String serialNumber;

    @Column(name = "express_company")
    private String expressCompany;

    @Column(name = "express_number")
    private String expressNumber;

    protected void copyBase(OrdersBase other) {
        setUserId(other.getUserId());
        setName(other.getName());
        setProvince(other.getProvince());
        setCity(other.getCity());
        setAddress(other.getAddress());
        setUseComments(other.getUseComments());
        setServiceComments(other.getServiceComments());
        setStatus(other.getStatus());
        setSerialNumber(other.getSerialNumber());
        setExpressCompany(other.getExpressCompany());
        setExpressNumber(other.getExpressNumber());
    }

    public long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        if(userId == null) {
            this.userId = 0;
        } else {
            this.userId = userId;
        }
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getProvince() {
        return province;
    }

    public void setProvince(String province) {
        this.province = province;
    }

    public String getCity() {
        return city;
    }

    public void setCity(String city) {
        this.city = city;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getUseComments() {
        return useComments;
    }

    public void setUseComments(String useComments) {
        this.useComments = useComments;
    }

    public String getServiceComments() {
        return serviceComments;
    }

    public void setServiceComments(String serviceComments) {
        this.serviceComments = serviceComments;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public String getSerialNumber() {
        return serialNumber;
    }

    public void setSerialNumber(String serialNumber) {
        this.serialNumber = serialNumber;
    }

    public String getExpressCompany() {
        return expressCompany;
    }

    public void setExpressCompany(String expressCompany) {
        this.expressCompany = expressCompany;
    }

    public String getExpressNumber() {
        return expressNumber;
    }

    public void setExpressNumber(String expressNumber) {
        this.expressNumber = expressNumber;
    }

    public String getPhoneNumber() {
        return phoneNumber;
    }

    public void setPhoneNumber(String phoneNumber) {
        this.phoneNumber = phoneNumber;
    }

}
